import {observable, action} from "mobx";

class Store {
    // 利用
    @observable todos = [
        {
            title: "todo标题",
            done: false,
        },
        {
            title: "已经完成 todo 的标题",
            done: true,
        }
    ];

    @observable name = 'xungege'
    @action getName = () => {
        return this.name;
    }
    @action setName = (name) => {
        console.log(`set name:${name}`);
        this.name = name;
        console.log(`set name:${this.name}`);
    }
    @action getList = ()=>{
        return this.todos;
    }
}

export default new Store()